<template>
  <view class="list-box"><!-- v-show="item.goods_small_logo && item.goods_price" -->
  <view class="list-item">
    <view class="list-left">
        <radio :checked=item.goods_state color="#c00000" v-if="showRadio"  @click="handlerRadio(item.goods_id,item.goods_state)"/>
      <image :src="item.goods_big_logo" mode="heightFix" class="leftImage"></image>
    </view>
  
    <view class="list-right">
      <view class="list-text">
        <text>{{item.goods_name}}</text>
      </view>
      <view class="list-bottom">
       <text>¥{{item.goods_price|pice}}</text>
     <uni-number-box :min="1" :value="item.goods_count" v-if="showNumber" @change="numberItem"></uni-number-box>
     
      </view>
    </view>
  </view>
  
  </view>
</template>

   
<script>
  export default {
    props:{
        item:{},
        showRadio:false,
        showNumber:false
   
      
     //  item:{
     // type: Object,
     //      default: {}
     //    }
    },
       // goods: {
       //      type: Object,
       //      default: {}
       //    },
    data() {
      return {
        
      };
    },
    filters:{
      pice(num){
         return num.toFixed(2)
      }
    },
    methods:{
      numberItem(val){
        this.$emit("number-change",{
          goods_count:+val,
          goods_id:this.item.goods_id
        })
      },
      handlerRadio(id,state){
      this.$emit("radio-change",{   
        goods_id:id,
        goods_state:!state
      })
      },
    
    }
  }
</script>


<style lang="scss">
  .list-box {
    .list-item {
      height: 150px;
      display: flex;
      margin: 0px 10px;
      box-shadow: 5px 5px 5px #E5E5E5;

      .list-left {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 140px;
        height: 140px;
        padding: 5px;

        .leftImage {
      
          width: 100%;
          height: 100%;
        }
      }

      .list-right {
        display: flex;
        flex-wrap: wrap;
        flex-direction: column;
        justify-content: space-between;

        .list-text {
          font-size: 13px;
          padding: 5px;
        }

        .list-bottom {
          font-size: 18px;
          font-weight: bold;
          padding: 10px 0;
          color: red;
          display: flex;
          justify-content: space-between;
          align-items:center;
        }
       
      }
    }
  }

</style>
